package com.godofgamblers.hotelmanagementsystem.handler;

import com.godofgamblers.hotelmanagementsystem.pojo.RoomCount;
import com.godofgamblers.hotelmanagementsystem.service.BackHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/*

@author huanglang

@create_time 2019-10-17 09:31

Nothing is difficult but bugs

    处理后台主页请求
*/
@Controller
@RequestMapping("back_home")
public class BackHomeHandler {

    @Autowired
    private BackHomeService backHomeService;

    @ResponseBody
    @RequestMapping("rooms_stock")
    public List<RoomCount> roomsStockOfDay(String day) {
        List<RoomCount> roomsStock = null;
        roomsStock = backHomeService.getRoomsStockOfDay(day);
        return roomsStock;
    }
}
